package com.eas.biz.service.statistic.query;

public class StatisticServiceQuery {

    private boolean withSubjectStatistic;

    private boolean withGradeStatistic;

    private String sortField;

    private String sortOrder;

    public boolean isWithSubjectStatistic() {
        return withSubjectStatistic;
    }

    public void setWithSubjectStatistic(boolean withSubjectStatistic) {
        this.withSubjectStatistic = withSubjectStatistic;
    }

    public boolean isWithGradeStatistic() {
        return withGradeStatistic;
    }

    public void setWithGradeStatistic(boolean withGradeStatistic) {
        this.withGradeStatistic = withGradeStatistic;
    }

    public void sortByMaxScore(boolean isDesc) {
        sortField = "max_score";
        sortOrder = isDesc ? "desc" : "asc";
    }

    public void sortByMinScore(boolean isDesc) {
        sortField = "min_score";
        sortOrder = isDesc ? "desc" : "asc";
    }

    public void sortByAvgScore(boolean isDesc) {
        sortField = "avg_score";
        sortOrder = isDesc ? "desc" : "asc";
    }

    public void sortByDiviation(boolean isDesc) {
        sortField = "diviation";
        sortOrder = isDesc ? "desc" : "asc";
    }

    public String getSortField() {
        return sortField;
    }

    public String getSortOrder() {
        return sortOrder;
    }
}
